package com.scap.dfs.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the DEPARTMENT database table.
 * 
 */
@Embeddable
public class DepartmentPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="CODE")
	private String code;

	@Column(name="HOSPITAL_CODE")
	private String hospitalCode;

	public DepartmentPK() {
	}
	public String getCode() {
		return this.code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getHospitalCode() {
		return this.hospitalCode;
	}
	public void setHospitalCode(String hospitalCode) {
		this.hospitalCode = hospitalCode;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof DepartmentPK)) {
			return false;
		}
		DepartmentPK castOther = (DepartmentPK)other;
		return 
			this.code.equals(castOther.code)
			&& this.hospitalCode.equals(castOther.hospitalCode);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.code.hashCode();
		hash = hash * prime + this.hospitalCode.hashCode();
		
		return hash;
	}
	@Override
	public String toString() {
		return "DepartmentPK [code=" + code + ", hospitalCode=" + hospitalCode
				+ "]";
	}
	
	
}